<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script src="https://code.jquery.com/jquery.js"></script><!-- 导入JQuery方便使用ajax插件 -->
<title>电话地址</title>
</head>
<body>
<form class="form-horizontal" action="insertAddress" role="form">
		<input type="hidden" class="form-control" name="userid" value="${userid}">
		<div class="form-group">
			<label for="receivename" class="col-sm-2 control-label">收货人</label>
			<div class="col-sm-10">
				<input type="text" class="form-control" name="receivename"
					placeholder="请输入收货人姓名">
			</div>
		</div>
		<div class="form-group">
			<label for="address" class="col-sm-2 control-label">收货地址</label>
			<div class="col-sm-10">
				<input type="text" class="form-control" name="address"
					placeholder="请输入收货地址">
			</div>
		</div>
		<div class="form-group">
			<label for="email" class="col-sm-2 control-label">邮件地址</label>
			<div class="col-sm-10">
				<input type="text" class="form-control" name="email"
					placeholder="请输入邮件地址">
			</div>
		</div>
		<div class="form-group">
			<label for="phone" class="col-sm-2 control-label">电话/手机</label>
			<div class="col-sm-10">
				<input type="text" class="form-control" name="phone"
					placeholder="请输入电话/手机">
			</div>
		</div>
		<div class="form-check" style="margin-left: 60px;">
			<input type="radio" class="form-check-input" id="radio1"
				name="state" value="非默认地址" checked>非默认地址<label
				class="form-check-label" for="radio1"></label>
		</div>
		<div class="form-check" style="margin-left: 60px;">
			<input type="radio" class="form-check-input" id="radio2"
				name="state" value="默认地址">默认地址 <label
				class="form-check-label" for="radio2"></label>
		</div>

		<div class="form-group">
			<div class="col-sm-offset-2 col-sm-10">
				<button type="submit" class="btn btn-default">添加</button>
			</div>
		</div>
	</form>
<div id="mod">
	<table class="table table-striped">
		<thead>
			<tr>
				<th>收货人</th>
				<th>收货地址</th>
				<th>邮件地址</th>
				<th>电话/手机</th>
				<th>操作</th>
				<th></th>
			</tr>
		</thead>
		<tbody>
			<c:forEach var="adr" items="${address}">
				<tr>
					<td>${adr.receivename}</td>
					<td>${adr.address}</td>
					<td>${adr.email}</td>
					<td>${adr.phone}</td>
					<td><a class="a1" href="findAddressid?addressid=${adr.addressid}">修改</a>|
					<a class="a2" href="delAddress?addressid=${adr.addressid}">删除</a></td>
					<td>${adr.state}</td>
				</tr>
			</c:forEach>
		</tbody>
	</table>
	</div>
</body>
<script>
$(document).ready(function () {
    var mod=$("#mod");
    $(".a1").click(function (e) {
        e.preventDefault();
        mod.load($(this).attr("href"));
    })
})
</script>
</html>